package com.simon.http.model;

import com.simon.utils.SystemCode;
import io.swagger.annotations.ApiModelProperty;

import java.util.List;

/**
 * 分页查询返回消息
 * @author Jiajie.Mao
 *
 * @param <T>
 */
public class PageResponse<T> {

	@ApiModelProperty(value = "结果编码")
	private int code;

	@ApiModelProperty(value = "结果信息集合")
	private List<T> data;

	@ApiModelProperty(value = "结果消息")
	private String msg;

	@ApiModelProperty(value = "当前页条目数")
	private int size;

	@ApiModelProperty(value = "总条目数")
	private int totalElements;

	@ApiModelProperty(value = "总页数")
	private int totalPage;

	public PageResponse(){

	}

	public PageResponse(List<T> data, int size, int totalElements, int totalPage) {
		this.code = SystemCode.SYSTEM_SUCESS_CODE;
		this.msg = SystemCode.SYSTEM_SUCESS_TEXT;
		this.data = data;
		this.size = size;
		this.totalElements = totalElements;
		this.totalPage = totalPage;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public List<T> getData() {
		return data;
	}

	public void setData(List<T> data) {
		this.data = data;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public int getSize() {
		return size;
	}

	public void setSize(int size) {
		this.size = size;
	}

	public int getTotalElements() {
		return totalElements;
	}

	public void setTotalElements(int totalElements) {
		this.totalElements = totalElements;
	}

	public int getTotalPage() {
		return totalPage;
	}

	public void setTotalPage(int totalPage) {
		this.totalPage = totalPage;
	}

	
	
	
}
